package com.example.securitydemo.config;

import lombok.Data;

@Data
public class DemoResult {

    private Integer code;

    private String message;

    private Object data;

    public static DemoResult success() {
        DemoResult demoResult = new DemoResult();
        demoResult.code = 0;
        demoResult.message = "请求成功";
        return demoResult;
    }

    public static DemoResult success(Object data) {
        DemoResult demoResult = new DemoResult();
        demoResult.code = 0;
        demoResult.message = "请求成功";
        demoResult.data = data;
        return demoResult;
    }

    public static DemoResult success(String message) {
        DemoResult demoResult = new DemoResult();
        demoResult.code = 0;
        demoResult.message = message;
        return demoResult;
    }
}
